package com.tyk.bookstore.front.auth.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.front.auth.model.enume.MemberState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(name = "Member", description = "会员")
@Data
@TableName("member")
public class MemberDo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1;

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "账号/会员名")
    @TableField("account")
    private String account;

    @Schema(description = "手机号")
    @TableField("phone")
    private String phone;

    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @Schema(description = "账户余额")
    @TableField("amount")
    private BigDecimal amount;

    @Schema(description = "支付密码")
    @TableField("payment_password")
    private String paymentPassword;

    @Schema(description = "状态[0可用，1禁用，2注销]")
    @TableField("state")
    private MemberState state;

    @Schema(description = "创建时间")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(value = "update_time")
    private LocalDateTime updateTime;
}
